<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'MyJsp.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<script type="text/javascript" src="<%=path%>/js/teacher/teaHomework.js"></script>
  </head>
  
  <body style="text-aglin:center">
	  	<center>
	  	<a href="javascript:void(0)" id="addHomework">添加作业</a><br>
	   		<table id="addTable">
	   			<tr>
	   				<td><s:textfield label="作业名称" name="homeworkName" id="textfield"></s:textfield></td>
	   			</tr>
	   			<tr>
	   				<td><s:select label="课程"  id="select" list="courseList" headerKey="0" headerValue="选择课程" listKey="courseName" listValue="courseName"></s:select></td>
	   			</tr>
	   			<tr>
	   				<td><s:textarea label="作业内容" name="homeworkContent" id="textarea"></s:textarea></td>
	   			</tr>
	   			<tr>
	   				<td><input type="submit" value="提交"/ id="tijiaoHomework"></td>
	   			</tr>
	   		</table>
	   		<s:if test="homeworkList!=null||homeworkList!=''">
		   		<table border="1" style="text-align: center">
		   			<thead>
		   				<tr>
		   					<td>作业名称</td>
		   					<td>内容</td>
		   					<td>课程</td>
		   					<td>操作</td>
		   					<td>path</td>
		   					<td>fef</td>
		   				</tr>
		   			</thead>
		   			
		   			<s:iterator value="homeworkList" status="index">
		   				<s:set name="teaid" value="belongTea"></s:set>
		   				
		   				<s:if test="belongTea==#session.tea.teaUserID">
	   					<tr>
	   						<td><s:property value="homeworkName"/></td>
	   						<td><s:property value="homeworkContent"/></td>
	   						<td><s:property value="courseName"/></td>
	   						<td><a href="javascript:void(0)" class="download" name="<s:property value="homePath"/>">下载</a></td>
	   						<td><s:property value="homePath"/></td>
	   					</tr>
	   					</s:if>
	   				</s:iterator>
		   		</table>	
	   		</s:if>
	  </center>
	  <s:debug></s:debug>
  </body>
</html>
